package one.bugu.android.demon.common;

import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: LangK
 * Date: 2017/12/20
 * Time: 10:54
 * Description:分页工具类
 */
public class Page {

    private static final int PAGESIZE_DEFAULT = 10;

    public Page() {
        this.currentPage = 1;
        this.pageSize = PAGESIZE_DEFAULT;
    }

    public Page(int currentPage) {
        this.currentPage = currentPage;
        this.pageSize = PAGESIZE_DEFAULT;
    }

    public Page(int currentPage, int pageSize) {
        this.currentPage = currentPage;
        this.pageSize = pageSize;
    }

    /**
     * 当前页码
     */
    private int currentPage;

    /**
     * 每页大小
     */
    private int pageSize;

    /**
     * 总大小
     */
    private int totleSize;

    /**
     * 总页数
     */
    private int totlePage;

    /**
     * 加载时间
     */
    private Date loadTime;

    /**
     * 检查是否还有下一页
     * @return
     */
    public boolean checkNext(){
        if (currentPage>=totlePage){
            return false;
        }else{
            return true;
        }
    }

    /**
     * 下一页
     */
    public void next(){
        currentPage++;
    }

    /**
     * 重置
     */
    public void reset() {
        currentPage = 1;
    }

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotleSize() {
        return totleSize;
    }

    public void setTotleSize(int totleSize) {
        this.totleSize = totleSize;
    }

    public int getTotlePage() {
        return totlePage;
    }

    public void setTotlePage(int totlePage) {
        this.totlePage = totlePage;
    }

    public Date getLoadTime() {
        return loadTime;
    }

    public void setLoadTime(Date loadTime) {
        this.loadTime = loadTime;
    }


}
